#ifndef OPENCVSCENE_H
#define OPENCVSCENE_H

#include <opencv/cv.h>
#include <opencv/highgui.h>

#include <QImage>
#include <QGraphicsPixmapItem>

class COpenCV
{
public:
        COpenCV();
        ~COpenCV();

public:
        bool StartCapture(int width, int height);
        bool StopCapture();
        bool IsCaptureStarted() const { return (m_Camera != NULL); }

        IplImage* QueryFrame();
        IplImage* GetGrayImage();
        IplImage* GetBGRAImage();
        IplImage* GetImage();

        bool GetImageSizes(int &width, int &height) const;
private:
        CvCapture				*m_Camera;

        IplImage				*m_GrayImage;
        IplImage				*m_BGRAImage;
        IplImage				*m_FlippedImage;
        IplImage                                *original;

};

#endif // OPENCVSCENE_H
